package com.itstudio.portal.utils;

import com.itstudio.portal.entity.UserInfo;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtil {

    public static  Long getUserId(){
        UserInfo userInfo = (UserInfo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return   userInfo.getUser().getId();
    }
}
